package com.long1008.mapper;

import com.long1008.pojo.AllSalary;
import com.long1008.pojo.EmpEc;
import com.long1008.pojo.Salary;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface SalaryMapper {
    int addSalary(@Param("salary") Salary salary);

    List<Salary> getAllSalaryByPage(
            @Param("page") Integer page,
            @Param("size") Integer size);

    List<Salary> getAllSalary();

    Long getAllSalaryCount();

    int updateSalary(@Param("salary") Salary salary);

    int deleteSalary(@Param("ids") String[] ids);

    int deleteSalaryByEid(@Param("eid") Long eid);

    int addSidAndEid(@Param("sid") Integer sid, @Param("eid") Long eid);

    Salary getSalaryById(Long id);

    int getLeaveCountByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);
    EmpEc getLeaveByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);
    int getLateCountByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);
    EmpEc getLateByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);

    int getOvertimeByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);
    EmpEc getOverByMonth(
            @Param("eid") Long eid,
            @Param("month") Date month);

    int getLateCount(Long eid);

    int getOvertime(Long eid);

    int getLeaveCount(Long eid);

    Salary getEmpSalaryById(Long sid);

    AllSalary getSalaryByEid(Long eid);

    Integer separateBySalary12500();

    Integer separateBySalary15000();

    Integer separateBySalary17500();

    Integer separateBySalary20000();

    Integer separateBySalary22500();

    Integer separateBySalary25000();

    List<AllSalary> querySalaryByEmpIds(@Param("list") List<Long> empIdList);

    List<EmpEc> queryEmpEcByEids(@Param("list")List<Long> ids);

    List<EmpEc> queryEmpEcByMonthAndEids(
            @Param("month") Date month,
            @Param("list")List<Long> ids);
}
